-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpu/esp: change dynamic SSID option handling #17415
cpu/esp: change dynamic SSID option handling #17415
Conversation
The semantics of defining an SSID prefix that overrides the already defined SSID exactly when and only when it is set, and then enabling dynamic SSID generation with that prefix, made handling the parameter definition unnecessarily difficult and hard to understand. Defining a boolean option that enables dynamic SSID generation, which then simply reuses the defined SSID as a prefix, makes it much more understandable and easier to handle, especially with respect to Kconfig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK.
@jeandudey Can we merge it? |
Yes, tested on |
Previously, a default value for ESP_WIFI_PASS was intentionally defined only if DOXYGEN was also defined, to allow ESP_WIFI_PASS to be left undefined for using APs without authentication. With PR RIOT-OS#17415 the definition was changed to always define a default value for EPS_WIFI_PASS. This made it impossible to use APs without authentication. The commit reverts this change.
/** | ||
* @brief Passphrase used for the AP as clear text (max. 64 chars). | ||
*/ | ||
#ifdef DOXYGEN | ||
#ifndef ESP_WIFI_PASS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ESP_WIFI_PASS
was intentionally defined only when DOXYGEN
is also defined to allow ESP_WIFI_PASS
to be left undefined for using APs without authentication. There are no other changes in this PR affected by this change.
Contribution description
This PR simplifies the definition of the option to use dynamic SSIDs for the SoftAP, especially with regard to the migration to
Kconfig
.The semantics of defining a separate SSID prefix string that overrides the already defined SSID and enables the dynamic SSID generation with that prefix exactly when and only when it is set, made the handling of the parameter definition unnecessarily difficult and hard to understand.
Defining a boolean option that just enables the dynamic SSID generation, which then simply reuses the defined SSID as a prefix, makes it much more understandable and easier to handle, especially with respect to Kconfig.
This PR removes the configuration parameter
ESP_WIFI_PREFIX
and introduces the boolean configuration parameterESP_WIFI_SSID_DYNAMIC
which is defined as 0 by default. If set to 1, the already definedESP_WIFI_SSID
is used as prefix to generate a dynamic SSID by extending it with the MAC address of the SoftAP interface used, e.g.:RIOT_AP_aabbccddeeff
Testing procedure
Compile and flash test application
with and without
-DESP_WIFI_SSID_DYNAMIC=1
inCFLAGS
and use any WiFi device to check the used SSID.Without
-DESP_WIFI_SSID_DYNAMIC=1
, the SSID of the SoftAP should beRIOT_AP
, with-DESP_WIFI_SSID_DYNAMIC=1
, the SSID of the SoftAP should be something likeRIOT_AP_<mac>
Issues/PRs references